package com.luoying.itew.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import androidx.annotation.Nullable;



public  class DataBaseHelper extends SQLiteOpenHelper {
    private DBListener listener;

    public DataBaseHelper(@Nullable Context context, @Nullable String name,@Nullable int version,DBListener listener) {
        super(context, name, null, version);
        this.listener = listener;
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        listener.onCreate(db);

    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        listener.onUpgrade(oldVersion,newVersion);
    }

    @Override
    public synchronized void close() {
        super.close();
    }
}
